package com.hb.core.pojo.project.proj.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.hb.core.pojo.Attachments;
import com.hb.core.pojo.OrganizeInfo;
import com.hb.core.pojo.parent.MPCommonEntity;
import com.hb.core.pojo.project.section.dto.BidSectionDTO;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.extern.slf4j.Slf4j;

import java.math.BigDecimal;
import java.util.List;

/**
 * 项目信息表
 *
 * @author zhaojk
 * @since 2021-09-03
 */
@Data
@Slf4j
@EqualsAndHashCode(callSuper = true)
@TableName("trade_project")
@ApiModel(value = "Project对象", description = "项目信息表")
public class AbstractProject extends MPCommonEntity {

    @ApiModelProperty(value = "用户ID")
    private Long userId;

    @ApiModelProperty(value = "企业ID")
    private Long orgId;

    @ApiModelProperty(value = "招标项目编号(系统生成)")
    private String tenderProjectCode;

    @ApiModelProperty(value = "项目编号")
    private String projectCode;

    @ApiModelProperty(value = "项目名称")
    private String projectName;

    @ApiModelProperty(value = "项目地区(省)")
    private String province;

    @ApiModelProperty(value = "项目地区(市)")
    private String city;

    @ApiModelProperty(value = "项目地区(区)")
    private String area;

    @ApiModelProperty(value = "行业分类, 关联字典")
    private String industryType;

    @ApiModelProperty(value = "项目分类, 关联字典")
    private String projectType;

    @ApiModelProperty(value = "项目分类二级, 关联字典")
    private String projectTypeTwo;

    @ApiModelProperty(value = "项目经理")
    private String manager;

    @ApiModelProperty(value = "保证金收款银行")
    private String bankName;

    @ApiModelProperty(value = "招标方式(招标, 询价等)")
    private Integer bidWay;

    @ApiModelProperty(value = "项目模块 1 建设工程 2 政府采购 3 企业采购")
    private Integer projectModule;

    @ApiModelProperty(value = "是否需要购标")
    private Integer buyFlag;

    @ApiModelProperty(value = "附件")
    private Attachments attachment;

    @ApiModelProperty(value = "备注")
    private String note;

    @ApiModelProperty(value = "审核状态(1: 审核通过, 2: 未审核, 3: 审核不通过)")
    private Integer auditStatus;

    @ApiModelProperty(value = "采购组织形式(1: 委托采购, 2:自行采购)")
    private Integer purchaseType;

    /**
     * 该字段除单一来源采购采购以外都有
     * 单一来源采购默认为邀请
     */
    @ApiModelProperty(value = "项目招标类型: 1: 公开, 2: 邀请")
    private Integer commonType;

    /**
     * 采购组织形式为自行招标时
     * 当前登录用户是采购人同时也是代理机构
     * 采购组织形式为委托招标时
     * 当前登录用户为代理机构, 需要选择招标人信息
     * 该字段关联系统中的机构信息库中的所有招标人
     */
    @ApiModelProperty(value = "采购单位(招标单位)")
    private OrganizeInfo biddingOrganizeInfo;

    @ApiModelProperty(value = "代理机构")
    private OrganizeInfo agencyOrganizeInfo;

    @ApiModelProperty(value = "采购概况及范围")
    private String procurementOverviewScope;

    @ApiModelProperty(value = "采购条件")
    private String purchaseCondition;

    @ApiModelProperty(value = "投标人资格要求")
    private String qualificationRequirementsBidder;

    @ApiModelProperty(value = "联合体投标")
    private Integer consortiumBiddingFlag;

    @ApiModelProperty(value = "是否分标段")
    private Integer bidFlag;

    @ApiModelProperty(value = "系统使用费")
    private BigDecimal systemUseFee;

    @ApiModelProperty(value = "收款方(系统使用费)")
    private String sysPayee;

    @ApiModelProperty(value = "收款方式(系统使用费) 1 支付宝 2 微信 3 银联")
    private Integer sysPayType;

    @ApiModelProperty(value = "银行账号(系统使用费)")
    private String sysBankAccount;

    @ApiModelProperty(value = "银行户名(系统使用费)")
    private String sysBankAccountName;

    @ApiModelProperty(value = "开户行(系统使用费)")
    private String sysBankDeposit;

    @ApiModelProperty(value = "收款码(系统使用费)")
    private String sysCollectionCode;

    @ApiModelProperty(value = "是否报名(是否需要备案)")
    private Integer signUpFlag;

    @ApiModelProperty(value = "是否收取报名费")
    private Integer registrationFeeFlag;

    @ApiModelProperty(value = "报名费金额")
    private BigDecimal registrationFeeMoney;

    @ApiModelProperty(value = "收款方(报名费)")
    private String signPayee;

    @ApiModelProperty(value = "收款方式(报名费) 1 支付宝 2 微信 3 银联")
    private Integer signPayType;

    @ApiModelProperty(value = "银行账号(报名费)")
    private String signBankAccount;

    @ApiModelProperty(value = "银行户名(报名费)")
    private String signBankAccountName;

    @ApiModelProperty(value = "开户行(报名费)")
    private String signBankDeposit;

    @ApiModelProperty(value = "收款码(报名费)")
    private String signCollectionCode;

    /* ============================ DTO相关属性 start ============================ */
    @TableField(exist = false)
    @ApiModelProperty(value = "标段列表")
    private List<BidSectionDTO> sections;

    @TableField(exist = false)
    @ApiModelProperty(value = "项目标题")
    private String title;

    @TableField(exist = false)
    @ApiModelProperty(value = "项目经理名称")
    private String managerName;

    @TableField(exist = false)
    @ApiModelProperty(value = "项目分类名称")
    private String projectTypeName;

    @TableField(exist = false)
    @ApiModelProperty(value = "项目类型名称")
    private String bidWayName;

    @TableField(exist = false)
    @ApiModelProperty(value = "联合体投标名称")
    private String consortiumBiddingFlagName;

    @TableField(exist = false)
    @ApiModelProperty(value = "项目地区(省)")
    private String provinceName;

    @TableField(exist = false)
    @ApiModelProperty(value = "项目地区(市)")
    private String cityName;

    @TableField(exist = false)
    @ApiModelProperty(value = "项目地区(区)")
    private String areaName;


    @TableField(exist = false)
    @ApiModelProperty(value = "行业分类名称")
    private String industryTypeName;

    @TableField(exist = false)
    @ApiModelProperty(value = "所属公司")
    private String orgName;

    /* ============================ 查询相关参数 start ============================ */
    @TableField(exist = false)
    @ApiModelProperty(value = "查询项目详情时是否携带标段信息, true: 带着, false: 不带")
    private Boolean withSections;

    @TableField(exist = false)
    @ApiModelProperty(value = "该项目下是否存在公告，1：存在 2：不存在")
    private Integer hasNotice;
}
